package com.tedu.ds.sessionAndMessage.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.classgraph.json.Id;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "ds_message")
public class MessagePO {

    @Id
    @ApiModelProperty(value = "消息id", example = "1")
    private Long id;

    @Field(type = FieldType.Integer)
    @ApiModelProperty(value = "对话id", example = "1", required = true)
    private Integer sessionId;

    @Field(type = FieldType.Long)
    @ApiModelProperty(value = "客户id", example = "1")
    private Long custId;

    @Field(type = FieldType.Long)
    @ApiModelProperty(value = "客服id", example = "1")
    private Long csId;

    @Field(type = FieldType.Text, analyzer = "standard")
    @ApiModelProperty(value = "聊天消息", example = "您好，有什么可以帮助您的？", required = true)
    private String message;

    @Field(type = FieldType.Date,format = DateFormat.date_time, pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "记录聊天发送的时间", example = "2023-10-24 20:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GTM+8")
    private Date createTime;

    @Field(type = FieldType.Keyword)
    @ApiModelProperty(value = "读取情况'", example = "1", required = true)
    private String status;
}
